package com.vancouver.knows.ui.base;

import android.os.Bundle;
import butterknife.ButterKnife;

import com.facebook.appevents.AppEventsLogger;
import com.pangu.ui.AActivity;
import com.vancouver.knows.MainApplication;
import com.vancouver.knows.MainApplication.TrackerName;

/*
 * Created by chenxunlin01 on 2015/11/5.
 */
public class BaseActivity extends AActivity<MainApplication> {

	@Override
	public void setContentView(int layoutResID) {
		super.setContentView(layoutResID);
		injectViews();
	}

	public void setContentViewWithoutInject(int layoutResId) {
		super.setContentView(layoutResId);
	}

	protected void injectViews() {
		ButterKnife.bind(this);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		imContext.getTracker(TrackerName.GLOBAL_TRACKER);
		AppEventsLogger.activateApp(this);
	}

	@Override
	protected void onResume() {
		super.onResume();
		AppEventsLogger.activateApp(this);
	}

	@Override
	protected void onPause() {
		super.onPause();
		AppEventsLogger.deactivateApp(this);
	}
}
